package com.storeroompda.tool;

import android.app.Activity;
import android.util.DisplayMetrics;

public class ScreenHelper {



    private volatile static ScreenHelper screenHelper;

    public ScreenHelper(){

    }


    public static ScreenHelper getColorUtilInstance(){
        if (screenHelper == null) {
            synchronized (ScreenHelper.class) {
                if (screenHelper == null) {
                    screenHelper = new ScreenHelper();
                }
            }
        }
        return screenHelper;
    }

    /** 获取屏幕的宽度 */
    public final  int getWindowsWidth(Activity activity) {
        DisplayMetrics dm = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
        return dm.widthPixels;
    }
    /** 获取屏幕的高度 */
    public final  int getWindowsHeight(Activity activity) {
        DisplayMetrics dm = new DisplayMetrics();
        activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
        return dm.heightPixels;
    }
}
